package com.new_wear.project.system.dept.controller;

import com.new_wear.framework.web.controller.BaseController;
import com.new_wear.framework.web.page.TableDataInfo;
import com.new_wear.project.system.dept.domain.DeptDto;
import com.new_wear.project.system.dept.service.DeptServiceImpl;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.ArrayList;

/**
 * @author ZhangRenpeng
 * @Description:
 * @date 2020/1/8 17:53
 */
@Controller
@RequestMapping("/system/deptDtoList")
public class DeptDtoController extends BaseController {

    @Autowired
    private DeptServiceImpl deptService;

    private String prefix = "system/deptDtoList";

    @RequiresPermissions("system:deptDtoList:view")
    @GetMapping()
    public String nav()
    {
        return prefix + "/deptDtoList";
    }
    /*发稿统计*/
    @RequiresPermissions("system:deptDtoList:list")
    @PostMapping("/list")
    @ResponseBody
    public TableDataInfo cstdeptlist()
    {
        startPage();
        ArrayList<DeptDto> deptDtos = deptService.selectDeptDtoList();//查询所有地区

        return getDataTable(deptDtos);
    }
}
